<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/7/8
 * Time: 11:29
 */

namespace app\admin\model;

use think\Model;

class BaseM extends  Model
{

    /*
     * created_at
     * 驼峰式规则
     * */
    public function getCreatedAtAttr($value){
        return date('Y-m-d H:i:s',$value);
    }

    /*
     * updated_at
     * 驼峰式规则
     * */
    public function getUpdatedAtAttr($value){
        return date('Y-m-d H:i:s',$value);
    }

    /*
    * 根据ID信息
    * */
    public function getById($id){
        return $this->where(["id"=>$id])->find();
    }

}